from rest_framework.serializers import ModelSerializer
from erp_system.models import RolesModel
from .permissions_serializer import PermissionsSerializer


class BaseRolesSerializer(ModelSerializer):
    """
    普通的序列化类，支持：新增，修改（修改角色的名字），删除，查询
    """
    permissions = PermissionsSerializer(many=True, read_only=True)

    class Meta:
        model = RolesModel
        fields = '__all__'
